package com.hgw.Demo06_MementoPattern.Exercises21_7_6;

/**
 * Data time:2021/12/18 22:17
 * StudentID:2019112118
 * Author:hgw
 * Description: 客户端测试类
 */
public class Client {
    public static void main(String[] args) {
        GameScene scene = new GameScene();
        Caretaker ct = new Caretaker();
        scene.setScene("无名湖");
        scene.setLifeValue(3);
        System.out.println("原始状态 ：");
        scene.display();
        ct.setMemento(scene.save());
        System.out.println("-------------");

        scene.setScene("魔鬼洞");
        scene.setLifeValue(0);
        System.out.println("牺牲状态：");
        scene.display();
        System.out.println("-------------");

        scene.restore(ct.getMemento());
        System.out.println("恢复到原始状态： ");
        scene.display();
        System.out.println("-------------");

    }
}
